/* 
* TODO: 1. Place the .txt data file and the dictionary file you downloaded in the work folder, or enter the full path to these files!
*       2. You may have to increase memory using the 'set mem' statement. It is commented out in the code bellow.
*
* If you have any questions or need assistance contact info@socialexplorer.com.
*/

///set mem 512m
clear all
version 11
set more off
cd "C:\Users\dengh\Dropbox\Yale\Research\APEEP\data\income"
infile using "1990_R12408290.dct", using("1990_R12408290_SL050.txt") clear

destring FIPS, generate(fips)
ren T065_001 income_2000usd
ren T001_001 pop
keep fips income* pop
codebook income*

/*
-----------------------------------------------------------------------------------------------------------------------------
income_2000usd                               Per Capita Income  In 2000 Dollars [Dollars adjusted for inflation to match valu
-----------------------------------------------------------------------------------------------------------------------------

                  type:  numeric (double)

                 range:  [4581.9687,38057.025]        units:  1.000e-06
         unique values:  2581                     missing .:  0/3141

                  mean:   14969.5
              std. dev:   3652.31

           percentiles:        10%       25%       50%       75%       90%
                             11351   12741.5   14365.4   16360.7   19249.1
*/

compress
saveold data_income_pop_1990, replace



